package sampleapp.client;

import sampleapp.shared.PersonInfo;

import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.ViewImpl;


public class PersonWidgetView extends ViewImpl implements
		PersonWidgetPresenter.MyView {

	private final Widget widget;

    @UiField
    TextBox txtFirstName;
    
    @UiField
    TextBox txtLastName;
	
	public interface Binder extends UiBinder<Widget, PersonWidgetView> {
	}

	@Inject
	public PersonWidgetView(final Binder binder) {
		widget = binder.createAndBindUi(this);
	}

	@Override
	public Widget asWidget() {
		return widget;
	}

	@Override
	public void setPersonInfo(PersonInfo persInfo) {
		// TODO Auto-generated method stub
		txtFirstName.setText(persInfo.getFirstName());
		txtLastName.setText(persInfo.getLastName());
	}
}
